<?php

	class ctl_points extends adminPage
	{
		var $workground = "sale";

		function setting()
		{
			$this->path[] = array('text'=>'注册送积分');
			//数组字段意义依次为 '注册积分开关','开始时间','结束时间','积分'
			$aConf = array('onoff','startdate','enddate','point');
			$oAlone = $this->system->loadModel('alone/points');
			$aData = $oAlone->getSetting($aConf);
			if (!$aData['onoff'])
			{
				$aData['onoff'] = 0;
			}
			foreach ($aData as $key => $var)
			{
				$this->pagedata[$key] = $var;
			}
			$this->page('alone/points_setting.html');
		}

		function toSetting()
		{
			$oAlone = $this->system->loadModel('alone/points');
			//error_log(print_r($oAlone,true),3,__FILE__.'.oAlone.log');	//alone
			$oAlone->toSetting($_POST);
			$this->splash('success','index.php?ctl=alone/points&act=setting',__('保存成功'));
		}
	}


?>